package com.platform.qujia.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;

//import com.alibaba.fastjson.JSONObject;
//import com.platform.qujia.constantEnum.TianQuetechPayTypeEnum;
import com.platform.qujia.pay.Payment;
import com.platform.qujia.pay.service.impl.TianQuetechPay;
import com.platform.qujia.service.NotifyService;

import io.swagger.annotations.Api;

@Controller
@RequestMapping("/notify")
@Api(tags = "支付回调")
public class NotifyController {

	private static Logger logger =(Logger) LoggerFactory.getLogger(NotifyController.class);
	
	@Autowired
	private NotifyService notifyService;
	
	/**
	 * 被扫支付回调
	 *
	 * @param request
	 * @param response
	 */
	@PostMapping("/tradeReverseScanPayNotify")
	@ResponseBody
	public JSONObject tradeReverseScanPayNotify(HttpServletRequest request, HttpServletResponse response) {
		logger.info("天阙随心付回调开始");
		return notifyService.tradeReverse(request, response);
	}
	
	
	
	
	
}
